﻿<UserControl 
  x:Class="CrackNET.InjectedViewer.View.Scriptorium.ScriptoriumView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  >
  <Grid 
    Background="{DynamicResource PrimaryBackgroundBrush}" 
    FocusManager.FocusedElement="{Binding ElementName=scriptEditor, Mode=OneTime}"
    >
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
      <RowDefinition Height="280" MinHeight="100" />
    </Grid.RowDefinitions>
    <TextBlock Margin="4" Grid.Row="0" HorizontalAlignment="Left" Text="IronPython Script Editor" />
    <TextBlock Margin="4" Grid.Row="0" HorizontalAlignment="Right">
      <TextBlock FontWeight="Bold" Text="INPUT" />
      <TextBlock Text="=" Margin="-4,0" />
      <TextBlock Margin="0,0,2,0" Text="{Binding Path=InputVariableDisplayText, Mode=OneTime}" />
    </TextBlock>
    <DockPanel Grid.Row="1" Margin="4,0,0,0">
      <StackPanel DockPanel.Dock="Bottom" Margin="0,4" Orientation="Horizontal">
        <Button 
          Command="{Binding Path=ExecuteScriptCommand, Mode=OneTime}" 
          Content="E_xecute Script (F5)"
          MinWidth="200" MaxWidth="200"
          />
        <Button 
          Command="{Binding Path=InsertStarterScriptCommand, Mode=OneTime}" 
          Content="_Insert Starter Script"
          Margin="8,0,0,0"
          MinWidth="200" MaxWidth="200"
          />
      </StackPanel>
      <TextBox 
        x:FieldModifier="private"
        x:Name="scriptEditor"
        AcceptsReturn="True" 
        AcceptsTab="True"
        FontSize="13"
        MinHeight="200"
        ScrollViewer.VerticalScrollBarVisibility="Auto"
        Text="{Binding Path=Script, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
        />
    </DockPanel>

    <GridSplitter 
      Grid.Row="2"
      BorderBrush="DarkGray" BorderThickness="1"
      Height="6" 
      HorizontalAlignment="Stretch"
      ResizeDirection="Rows" 
      VerticalAlignment="Top"
      />
    <GroupBox Grid.Row="2" Header="Execution Results" Margin="0,7,0,0">
      <DockPanel>
        <StackPanel DockPanel.Dock="Bottom" Margin="0,4,0,0" Orientation="Horizontal">
          <Button 
            Command="{Binding Path=ClearExecutionResultsCommand, Mode=OneTime}" 
            Content="_Clear Execution Results"
            MinWidth="200" MaxWidth="200"
            />
          <Button 
            Command="{Binding Path=SaveExecutionResultsCommand, Mode=OneTime}" 
            Content="_Save Execution Results" 
            Margin="8,0,0,0"
            MinWidth="200" MaxWidth="200"
            />
        </StackPanel>
        <TextBox 
          x:FieldModifier="private"
          x:Name="executionResultsEditor"
          FontSize="13" 
          ScrollViewer.VerticalScrollBarVisibility="Auto" 
          Text="{Binding Path=ExecutionResults, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
          />
      </DockPanel>
    </GroupBox>
  </Grid>
</UserControl>